package org.fude.convert;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Service;
@Service
public class DateConvert implements Converter<String,Date>{

	@Override
	public Date convert(String source) {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try {
			Date date = sf.parse(source);
			return date;
		} catch (ParseException e) {
			return null;
		}
		
	}

}
